AmCharts.translations.dataLoader={};AmCharts.addInitHandler(function(e){if(undefined===e.dataLoader||!s(e.dataLoader))e.dataLoader={};var t=e.version.split(".");if(Number(t[0])<3||3===Number(t[0])&&Number(t[1])<13)return;var a=e.dataLoader;a.remaining=0;a.percentLoaded={};var r={async:true,format:"json",showErrors:true,showCurtain:true,noStyles:false,reload:0,timestamp:false,delimiter:",",skip:0,skipEmpty:true,emptyAs:undefined,useColumnNames:false,init:false,progress:false,reverse:false,reloading:false,complete:false,error:false,numberFields:[],headers:[],chart:e};a.loadData=function(){if("stock"===e.type){setTimeout(function(){if(0>e.panelsSettings.startDuration){a.startDuration=e.panelsSettings.startDuration;e.panelsSettings.startDuration=0}for(var t=0;t<e.dataSets.length;t++){var r=e.dataSets[t];if(undefined!==r.dataLoader&&undefined!==r.dataLoader.url){p(r.dataLoader.init,r.dataLoader,e);r.dataProvider=[];d(r.dataLoader);n(r.dataLoader.url,r,r.dataLoader,"dataProvider")}if(undefined!==r.eventDataLoader&&undefined!==r.eventDataLoader.url){p(r.eventDataLoader.init,r.eventDataLoader,e);r.events=[];d(r.eventDataLoader);n(r.eventDataLoader.url,r,r.eventDataLoader,"stockEvents")}}},100)}else{p(a.init,a,e);d(a);if(undefined===a.url)return;if(undefined!==e.startDuration&&0<e.startDuration){a.startDuration=e.startDuration;e.startDuration=0}if("gauge"===e.type){if(undefined===e.arrows)e.arrows=[];n(a.url,e,a,"arrows")}else{if(undefined===e.dataProvider)e.dataProvider=e.type==="map"?{}:[];n(a.url,e,a,"dataProvider")}}};a.loadData();function n(t,r,s,o){if(undefined===o)o="dataProvider";if(s.showCurtain)u(undefined,s.noStyles);a.remaining++;a.percentLoaded[t]=0;if(s.progress!==undefined&&typeof s.progress==="function"&&s._progress===undefined){s._progress=s.progress;s.progress=function(e){a.percentLoaded[t]=e;var r=0;var n=0;for(var i in a.percentLoaded){if(a.percentLoaded.hasOwnProperty(i)){n++;r+=a.percentLoaded[i]}}var o=Math.round(r/n*100)/100;s._progress.call(this,o,Math.round(e*100)/100,t)}}AmCharts.loadFile(t,s,function(d){if(false===d){p(s.error,s,e);f(AmCharts.__("Error loading the file",e.language)+": "+t,false,s)}else{if(undefined===s.format){s.format="json"}s.format=s.format.toLowerCase();switch(s.format){case"json":r[o]=AmCharts.parseJSON(d);if(false===r[o]){p(s.error,s,e);f(AmCharts.__("Error parsing JSON file",e.language)+": "+a.url,false,s);r[o]=[];return}else{r[o]=i(r[o],s);p(s.load,s,e)}break;case"csv":r[o]=AmCharts.parseCSV(d,s);if(false===r[o]){p(s.error,s,e);f(AmCharts.__("Error parsing CSV file",e.language)+": "+a.url,false,s);r[o]=[];return}else{r[o]=i(r[o],s);p(s.load,s,e)}break;default:p(s.error,s,e);f(AmCharts.__("Unsupported data format",e.language)+": "+s.format,false,s.noStyles);return}a.remaining--;if(0===a.remaining){p(s.complete,e);if(s.async){if("map"===e.type){e.validateNow(true);c()}else{if("gauge"!==e.type){e.addListener("dataUpdated",function(t){if("stock"===e.type&&!s.reloading&&undefined!==e.periodSelector){e.periodSelector.setDefaultPeriod()}c();e.events.dataUpdated.pop()})}e.validateData();if("gauge"===e.type)c();if(a.startDuration){if("stock"===e.type){e.panelsSettings.startDuration=a.startDuration;for(var l=0;l<e.panels.length;l++){e.panels[l].startDuration=a.startDuration;e.panels[l].animateAgain()}}else{e.startDuration=a.startDuration;if(e.animateAgain!==undefined)e.animateAgain()}}}}}if(s.reload){if(s.timeout)clearTimeout(s.timeout);s.timeout=setTimeout(n,1e3*s.reload,t,r,s,o);s.reloading=true}}})}function i(t,r){if(undefined!==r.postProcess&&o(r.postProcess))try{return r.postProcess.call(a,t,r,e)}catch(n){f(AmCharts.__("Error loading file",e.language)+": "+r.url,false,r);return t}else return t}function s(e){return"object"===typeof e}function o(e){return"function"===typeof e}function d(e){for(var t in r){if(r.hasOwnProperty(t))l(e,t,r[t])}}function l(e,t,a){if(undefined===e[t])e[t]=a}function f(e,t,a){if(a.showErrors)u(e,a.noStyles);else{c();console.log(e)}}function u(t,r){c();if(undefined===t)t=AmCharts.__("Loading data...",e.language);var n=document.createElement("div");n.setAttribute("id",e.div.id+"-curtain");n.className="amcharts-dataloader-curtain";if(true!==r){n.style.position="absolute";n.style.top=0;n.style.left=0;n.style.width=(undefined!==e.realWidth?e.realWidth:e.divRealWidth)+"px";n.style.height=(undefined!==e.realHeight?e.realHeight:e.divRealHeight)+"px";n.style.textAlign="center";n.style.display="table";n.style.fontSize="20px";try{n.style.background="rgba(255, 255, 255, 0.3)"}catch(i){n.style.background="rgb(255, 255, 255)"}n.innerHTML='<div style="display: table-cell; vertical-align: middle;">'+t+"</div>"}else{n.innerHTML=t}e.containerDiv.appendChild(n);a.curtain=n}function c(){try{if(undefined!==a.curtain)e.containerDiv.removeChild(a.curtain)}catch(t){}a.curtain=undefined}function p(e,t,r,n){if("function"===typeof e)e.call(a,t,r,n)}},["pie","serial","xy","funnel","radar","gauge","gantt","stock","map"]);if(undefined===AmCharts.__){AmCharts.__=function(e,t){if(undefined!==t&&undefined!==AmCharts.translations.dataLoader[t]&&undefined!==AmCharts.translations.dataLoader[t][e])return AmCharts.translations.dataLoader[t][e];else return e}}AmCharts.loadFile=function(e,t,a){if(typeof t!=="object")t={};if(t.async===undefined)t.async=true;var r;if(window.XMLHttpRequest){r=new XMLHttpRequest}else{r=new ActiveXObject("Microsoft.XMLHTTP")}try{r.open("GET",t.timestamp?AmCharts.timestampUrl(e):e,t.async)}catch(n){a.call(this,false)}if(t.headers!==undefined&&t.headers.length){for(var i=0;i<t.headers.length;i++){var s=t.headers[i];r.setRequestHeader(s.key,s.value)}}if(t.progress!==undefined&&typeof t.progress==="function"){r.onprogress=function(e){var a=e.loaded/e.total*100;t.progress.call(this,a)}}r.onreadystatechange=function(){if(4===r.readyState&&404===r.status)a.call(this,false);else if(4===r.readyState&&200===r.status)a.call(this,r.responseText)};try{r.send()}catch(n){a.call(this,false)}};AmCharts.parseJSON=function(response){try{if(undefined!==JSON)return JSON.parse(response);else return eval(response)}catch(e){return false}};AmCharts.parseCSV=function(e,t){var a=AmCharts.CSVToArray(e,t.delimiter);var r=t.numberFields&&t.numberFields.length>0;var n=[];var i=[];var s,o;if(t.useColumnNames){i=a.shift();for(var d=0;d<i.length;d++){s=i[d].replace(/^\s+|\s+$/gm,"");if(""===s)s="col"+d;i[d]=s}if(0<t.skip)t.skip--}for(o=0;o<t.skip;o++)a.shift();var l;while(l=t.reverse?a.pop():a.shift()){if(t.skipEmpty&&l.length===1&&l[0]==="")continue;var f={};for(o=0;o<l.length;o++){s=undefined===i[o]?"col"+o:i[o];f[s]=l[o]===""?t.emptyAs:l[o];if(r&&t.numberFields.indexOf(s)!==-1)f[s]=Number(f[s])}n.push(f)}return n};AmCharts.CSVToArray=function(e,t){t=t||",";var a=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)"+'(?:"([^"]*(?:""[^"]*)*)"|'+'([^"\\'+t+"\\r\\n]*))","gi");var r=[[]];var n=null;while(n=a.exec(e)){var i=n[1];if(i.length&&i!==t){r.push([])}var s;if(n[2]){s=n[2].replace(new RegExp('""',"g"),'"')}else{s=n[3]}r[r.length-1].push(s)}return r};AmCharts.timestampUrl=function(e){var t=e.split("?");if(1===t.length)t[1]=(new Date).getTime();else t[1]+="&"+(new Date).getTime();return t.join("?")};
//# sourceMappingURL=dataloader.map.js